<?php
Zend_Loader::loadFile('../application/default/models/common.php');
class Form_Hotel extends Zend_Form
{
    public function init()
    {
		$this->setMethod('post');
		$this->addPrefixPath('Lion_Form_Element', '../library/Form/Element/', 'element');	
	  
		
		 
	   $this->addElement('hidden', 'hotel_id', array(
            
            'filters'    => array('int'),
            'class'			 => 'hidden',
           
        ));
        
		  $this->addElement('textarea', 'hotel_title', array(
            'label'      => 'Hotel Title:',
            'required'   => true,
            'filters'    => array('StringTrim'),
            'class'			 => 'textbox',
		    'rows'      =>3,
		    'columns'=> 3,
            'validators' => array(
            	array('validator' => 'StringLength', 'options' => array(0, 50))
            )
        ));
        
		 $Hotel_country= new Zend_Form_Element_Select('hotel_country');
         $Hotel_country ->setLabel('Hotel Country')
					->addMultiOptions($this->getcountries());
						
		$this->addElement($Hotel_country);
		
		 $Hotel_city= new Zend_Form_Element_Select('hotel_city');
         $Hotel_city ->setLabel('Hotel  City')
					->addMultiOptions($this->getcities());
						
		$this->addElement($Hotel_city);
		   
        $this ->addElement('formRTE', 'hotel_description',
    				array('label' =>'Hotel Description:', 
    					'required' =>true,    					
    					
    				)    				
		); 
      
		       
		 $this->addElement('text', 'hotel_contactperson', array(
            'label'      => 'Hotel Contact Person:',
            'required'   => true,
            'filters'    => array('StringTrim'),
            'class'			 => 'textbox',
            'validators' => array(
            	array('validator' => 'StringLength', 'options' => array(0, 100))
            )
        ));
        

        
		 $this->addElement('text', 'hotel_phone', array(
            'label'      => 'Hotel Phone:',
            'required'   => true,
            'filters'    => array('StringTrim'),
            'class'			 => 'textbox',
            'validators' => array(
            	array('validator' => 'StringLength', 'options' => array(0, 100))
            )
        ));
        
        $this->addElement('text', 'hotel_fax', array(
            'label'      => 'Hotel Fax:',
            'required'   => true,
            'filters'    => array('StringTrim'),
            'class'			 => 'textbox',
            'validators' => array(
            	array('validator' => 'StringLength', 'options' => array(0, 100))
            )
        ));
		
      $this->addElement('text', 'hotel_skype', array(
            'label'      => 'Hotel Skype:',
            'required'   => true,
            'filters'    => array('StringTrim'),
            'class'			 => 'textbox',
            'validators' => array(
            	array('validator' => 'StringLength', 'options' => array(0, 100))
            )
        ));
		
		 										
        $this->addElement('checkbox', 'is_Enabled', array(
            'label'      => 'Is Enabled:',
            'required'   => true,
            'filters'    => array('int'),
           
        ));
        
		  $this->addElement('submit', 'Add');
        
		
		
    }
    
  public function getcountries() {
    
        $common_model = new Common();
        $options=$common_model->listCountries();
       $arr=array(0=>'Select Country');
       $options=$arr+$options;
   //   print_r($options);exit;
        return $options;
    }
    
  public function getcities() {
    	
        $common_model = new Common();
        $options=$common_model->listCities();
      $arr=array(0=>'Select City');
       $options=$arr+$options;
   //   print_r($options);exit;
        return $options;
    }
}
